package com.example.springboot.controller;

import com.example.springboot.entity.User;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.ArrayList;
import java.util.HashMap;
import java.util.List;
import java.util.Map;

public class TestController {

    @GetMapping("get-data")
    public Map test(){
        Map<String,Object> map = new HashMap<>();
        map.put("data","hello world");
        return map;
    }

    public static void main(String[] args) {
        List<User> list = new ArrayList<>();
        list.add(new User(1));
        list.add(new User(2));
        list.add(new User(3));
        list.forEach(item -> System.out.println(item.getAccount()));
    }
}
